package com.atguigu.gulimall.auth.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * @create: 2024/9/5
 * @author: gyhe10
 * @description: 封装用户注册页输入数据的 VO
 **/
@Data
public class UserRegistVo {
    /**
     * 用户名
     */
    @NotEmpty(message = "用户名必须提交")
    @Length(min = 6, max = 18, message = "用户名长度必须在6-18位之间")
    private String username;
    /**
     * 密码
     */
    @NotEmpty(message = "密码必须填写")
    @Length(min = 6, max = 18, message = "密码长度必须在6-18位之间")
    private String password;
    /**
     * 手机号
     */
    @NotEmpty(message = "手机号必须填写")
    @Pattern(regexp = "^1[3|4|5|7|8]\\d{9}$", message = "手机号格式不正确")
    private String phone;
    /**
     * 验证码
     */
    @NotEmpty(message = "验证码必须填写")
    private String code;
}
